<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="d1">
    <h1>123</h1>
    <div id="d2">d2</div>
  </div>
  <script>
    let d1 = document.querySelector("#d1")
    let d2 = document.querySelector("#d2")
    let d2New = document.createElement("div")
    d2New.innerHTML = "<h3>h3</h3><h2>h2</h2>"
    console.log(d2New.childNodes)
    d2.innerHTML = "<h3>h3</h3><h2>h2</h2>"
    // d1.replaceChild(d2New.childNodes,d2)
  </script>
</body>
</html>